/*
	MIDAS Context Based Routing
	cbr_rtable.h
	Copyright (c) 2007 Radoslaw Olgierd Schoeneich
	MEAG IT PW
*/

#ifndef cbr_rtable_h_
#define cbr_rtable_h_

#include <list>

#include "cbr_types.h"

/**
 * Routing Table.
 */

class cbr_RTable : private cbr_Object {
private:
	struct entry {
		u_int32_t	trID;
		cbr_ID		dst;
		cbr_ID		forwarder;

		entry(u_int32_t t, cbr_ID d, cbr_ID f)
		{
			trID = t;
			dst = d;
			forwarder = f;
		}
	};

	typedef std::list<entry> routes_list;
	routes_list routes;

public:
	cbr_RTable() { }

	void		insert(u_int32_t trID, cbr_ID dst, cbr_ID fwdr);
	void		remove(u_int32_t trID, cbr_ID dst);
	bool		getForwarderID(u_int32_t trID,cbr_ID dst,cbr_ID *fwdr);
};


#endif	// cbr_rtable_h_
